function ii=dilute(v,th, k)
ii=[];
i=k+1;
while i<length(v)-k-1
  ii=[ii i];
  if all(v(i+(-k:k))<th) % all
     i=i+k;
  else
     i=i+1;
  end;
end